package com.project.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@Validated
@ApiModel(value = "Stall",description = "车位信息")
public class Stall implements Serializable,Cloneable {
    /**
     * 车位ID
     */

    @ApiModelProperty(value = "[自动增长]车位ID" ,example = "1")
    private Integer stall_id;
    /**
     * 车位大小
     */
    @Pattern(regexp = "(大|中|小)",message = "车位大小只能是大，中，小")
    @ApiModelProperty(value = "[必填项]车位大小",example = "大、中、小")

    private String stall_size;
    /**
     * 车位编号
     */

    @Pattern(regexp = "^[A-Z][0-9]{2,3}$",message = "车位编号错误")
    @ApiModelProperty(value = "[必填项]车位编号",example = "A001")
    private String stall_code;
    /**
     * 车位状态
     */
    @Pattern(regexp = "(出租中|停用|空闲)",message = "车位状态只能是出租中、空闲或停用")
    @ApiModelProperty(value = "[必填项]车位状态",example = "出租中、空闲、停用")
    private String stall_state;
    /**
     * 车位价格
     */
    //@Pattern(regexp = "(^[1-9]\\d*(\\.\\d{1,2})?$)|(^0(\\.\\d{1,2})?$)",message = "车位价格错误")
    @ApiModelProperty(value = "[必填项]车位价格",example = "100")
    private Double stall_price;

//图片
    @ApiModelProperty(value = "[选填项]车位照片",example = "选择照片")
    private String photo;
//    评价
    @ApiModelProperty(value = "[选填项]车位评价",example = "好好好")
    private  String evaluate;
    /**
     * 用户ID
     */
    @ApiModelProperty(value = "[必填项]车位对应的用户ID",example = "1")
    private Integer stall_user_id;
    @ApiModelProperty(value = "[必填项]车位所在物业ID",example = "1")
    private Integer management_id;

    private Management management;
    private Users users;
}
